package cn.dakaqi.web.api.v1;

import cn.dakaqi.activity.services.ActivityDao;
import cn.dakaqi.activity.services.ActivityService;
import cn.dakaqi.group.services.GroupDao;
import cn.dakaqi.group.services.GroupService;
import cn.dakaqi.group.services.GroupVolunteerDao;
import cn.dakaqi.group.services.GroupVolunteerService;
import cn.dakaqi.member.service.VolunteerDao;
import cn.dakaqi.user.service.AccountDao;
import cn.dakaqi.utils.BaseDAO;
import cn.dakaqi.utils.redis.RedisClientTemplate;
import cn.dakaqi.web.api.v2.ImportData;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by chunyang on 2016/4/26.
 */
@RestController
@RequestMapping(value = "/api/v1/test")
public class TestRestController
{
    @Autowired
    BaseDAO baseDAO;
    @Autowired
    AccountDao accountDao;
    @Autowired
    VolunteerDao volunteerDao;
    @Autowired
    GroupDao groupDao;
    @Autowired
    GroupVolunteerDao groupVolunteerDao;
    @Autowired
    ActivityDao activityDao;
    @Autowired
    RedisClientTemplate redisClientTemplate;

    @RequestMapping(value = "/",method = RequestMethod.GET)
    public void sql()
    {
        ImportData importData = new ImportData(redisClientTemplate,baseDAO,accountDao,volunteerDao,groupDao,groupVolunteerDao,activityDao);
        Thread t = new Thread(importData);
        t.start();
    }
}
